/*var data = require('./test.json');

console.log(data);*/

/*var http = require('http');
var data = require('./test.json');
var html = require('./index.html');
var server = http.createServer(function(req, res){
	res.writeHead(200, {'Content-Type':'text/html'});
	res.render(html);
});

server.listen(3000);*/

var http = require('http');
var fs = require('fs');
// var app = express();

var server = http.createServer(function(req, res){
	fs.readFile('./index.html', {encoding:'utf8',flag:'r'}, function(err, data){
		if(err){
			console.log(err);
			res.writeHead(404, {'Content-Type':'text/html'});
		}
		else{
			console.log(data);
			res.writeHead(200, {'Content-Type':'text/html'});
			res.write(data.toString());
		}
		res.end();
	});
});
server.listen(3000,function(){
	console.log('server start');
});

